<script>
import SelectMaterialByCategoryModal from './modal/SelectMaterialByCategoryModal.vue'

export default {
  name: 'SelectMaterialByCategory',
  components: { SelectMaterialByCategoryModal },
  methods:{
    handleOpenMaterialModal(){
      this.$refs.materialModal.showModal()
    },
    handleConfirm(selectionRows) {
      this.$emit('confirm', selectionRows)
    },
  }
}
</script>

<template>
  <div class="select-material-container table-operator">
    <a-button
      @click="handleOpenMaterialModal"
      type="primary"
      icon="plus">
      新增
    </a-button>
    <select-material-by-category-modal ref="materialModal" @confirm="handleConfirm"/>
  </div>
</template>

<style scoped>

</style>